home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / bsrc_250.zip / SB_NEW.C < prev    next >
C/C++ Source or Header  |  1991-09-15  |  5KB  |  92 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*              Window initialization routine for BinkleyTerm               */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  24. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  25. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  26. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  27. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /* You can contact Bit Bucket Software Co. at any one of the following      */
  31. /* addresses:                                                               */
  32. /*                                                                          */
  33. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  34. /* P.O. Box 460398                AlterNet 7:491/0                          */
  35. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  36. /*                                Internet f491.n343.z1.fidonet.org         */
  37. /*                                                                          */
  38. /* Please feel free to contact us at any time to share your comments about  */
  39. /* our software and/or licensing policies.                                  */
  40. /*                                                                          */
  41. /*                                                                          */
  42. /*   This module is derived from code developed by Augie Hansen in his      */
  43. /*   book "Proficient C" published by Microsoft Press.  Mr. Hansen was      */
  44. /*   kind enough to give us verbal permission to use his routines, and      */
  45. /*   Bob, Vince and Alan (and all our full screen users) are grateful.      */
  46. /*   If you decide to use this code in some package you are doing, give     */
  47. /*   some thought to going out and buying the book. He deserves that.       */
  48. /*                                                                          */
  49. /*--------------------------------------------------------------------------*/
  50.  
  51. /* Include this file before any other includes or defines! */
  52.  
  53. #include "includes.h"
  54.  
  55. /* Added by Greylock Software to facilitate MEWEL/Windows conversion */
  56. #ifndef MILQ
  57. void sb_caption( REGIONP Rgn, char *Caption )
  58. {
  59.    sb_move( Rgn, 0, 1 );
  60.    sb_puts( Rgn, Caption );
  61. }
  62. #endif
  63.  
  64. REGIONP sb_new (int top, int left, int height, int width)
  65. {
  66.    REGIONP new;
  67.  
  68.    new = calloc (1, sizeof (REGION));
  69.    if (new != NULL)
  70.       {
  71.       new->r0 = new->sr0 = top;
  72.       new->r1 = new->sr1 = top + height - 1;
  73.       new->c0 = new->sc0 = left;
  74.       new->c1 = new->sc1 = left + width - 1;
  75.       new->row = new->col = 0;
  76.       new->wflags = 0;
  77.       }
  78.    return (new);
  79. }
  80.  
  81. #ifdef MILQ
  82. void pascal sb_size( REGIONP Rgn ) {
  83.   RECT                  Rect;
  84.  
  85.   GetClientRect( Rgn->hWnd, &Rect );
  86.   Rgn->r0 = Rgn->sr0 = Rect.top;
  87.   Rgn->r1 = Rgn->sr1 = Rect.bottom - Rect.top + 1;
  88.   Rgn->c0 = Rgn->sc0 = Rect.left;
  89.   Rgn->c1 = Rgn->sc1 = Rect.right - Rect.left + 2;
  90.   }
  91. #endif
  92.